import { defaults } from "browserslist";
import store from "../store";

export function toast(msg, type) {

    switch (type) {
        case 'dander':
            type = 'icon-toast-shibai_huaban'
            break;
        case 'warnning':
            type = 'icon-toast-jinggao'
            break;
        default: 'icon-toast_chenggong'
    }

    store.commit('showToast', { msg, type })

    setInterval(() => {
        store.commit('hideToast')
    }, 3000)
}